clarify and implement the precedences of I/O hints #173
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(Text below also appears in sneak_peek.md)
file offset for the data section (header extent) and record variable
section.
nc_header_align_sizeby setting arguments ofh_minfree,v_align,v_minfree, andr_align.ncmpi_create()andncmpi_open(). Hints arenc_header_align_size,nc_var_align_size,and
nc_record_align_size.PNETCDF_HINTS. Hints arenc_header_align_size,nc_var_align_size, andnc_record_align_size.implements the following hint precedence.
PNETCDF_HINTS>ncmpi__enddef()>MPI info.PNETCDF_HINTS, e.g.PNETCDF_HINTS="nc_var_align_size=1048576". Making this the firstpriority is because it allows to run the same application executable
without source code modification using different alignment settings
through a run-time environment variable.
ncmpi_create()andncmpi_open(), e.g.MPI_Info_set("nc_var_align_size", "1048576");. The reasoning is when a3rd-party library built on top of PnetCDF implements its codes using
'ncmpi__enddef'. An application that uses such 3rd-party library can pass
an MPI info object to it, which further passes the info to PnetCDF. This
precedence allows that application to exercise different hints without
changing the 3rd-party library's source codes.
ncmpi__enddef(), e.g.ncmpi__enddef(..., v_align=1048576,...).nc_header_align_sizeis essentially the same as hintnc_var_align_size, but its name appears to be closer to the hint'sintent, i.e. to reserve some space for the header growth in the future when
new data objects are added. Please note when both hints are set, only hint
nc_var_align_sizewill take effect andnc_header_align_sizeignored.argument
v_minfreepassed toncmpi__enddef()is ignored. In thiscase, users should set
h_minfree, if an extra header space is desired.nc_header_align_size,nc_var_align_size, or argumentv_alignis set,nc_record_align_sizeorr_align, if set, will be used to align theheader extent.